import './assets/main.scss'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'

import 'element-plus/theme-chalk/dark/css-vars.css'
import '@/styles/element/dark/css-vars.scss'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import '@/styles/element/dark/index.scss'
// 只想导入scss？
// import 'element-plus/theme-chalk/src/dark/css-vars.scss'

// 引入组件

const vs = import.meta.env.VITE_BASE_PATH
console.log(vs)

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// // 定义全局组件 MyComponent
// // 注册全局组件
// app.component('MyComponent3', {
//   name: 'MyComponent3',
//   // 自定义渲染函数
//   render(): any {
//     // 调用 setup() 中返回的渲染函数
//     return h('div', [
//       h('h1', '通过vue的h函数自定义渲染'),
//       h('p', 'This content is rendered using a render function in setup()'),
//       h('button', { onClick: () => alert('Button clicked!') }, '点我')
//     ])
//   }
// }).component('StuDemo2', StuDemo2)

app.use(createPinia())
app.use(router)

app.mount('#app')
